#include <iostream>
#include <math.h>
using namespace std;

bool isRepeat(string s,int& i, int& j)
{
    for(int k = i;k < j;k++)
    {
        for(int l = k + 1;l < j;l++)
        {
//            cout<<s[k]<<","<<s[l]<<endl;
            if(s[k] == s[l])
            {
//                cout<<s[k]<<","<<s[l]<<endl;
                return true;
            }
        }
    }
    return false;
}



int length(string s)
{
    int i,j,num;
    int size = s.size();
    cout<<"size:"<<size<<endl;
    int Max = 0;


    for(i = 0;i < size;i++)
    {
        for(j = i+1;j <= size;j++)
        {
//            cout<<"(i,j):"<<i<<","<<j<<","<<s[i]<<","<<s[j]<<","<<isRepeat(s,i,j)<<endl;
            if(!isRepeat(s,i,j))
            {

            }
        }
    }

    return Max;
}

int length2(string s)
{
    int i,j=0,k=0;
    int size = s.size();
    int Max = (size == 1)?1:0;

    for(i = 1;i < size;i++)
    {
        for(j = k;j < i;j++)
        {
            if(s[j] == s[i])
            {
                k = j+1;
                break;
            }
        }
        Max = max(Max,i-k+1);
    }
    return Max;
}

int main() {
//    std::cout <<length2("abcdeffe")<<std::endl;
//    union NUM{
//        int a;
//        char b;
//    }num;
//    num.a=0x12345678;
//    printf("num.b=%X\n",num.b);
//short si=-8196;
//unsigned short usi=si;
//cout<<usi;
//    short si=-32768;
//    unsigned short usi=si;
//    cout<<usi;
    unsigned short usi=65535;
    short si=usi;
    cout<<si;
//int i=12345;
//float f=1.12345e3;
//bool r=f==(float)(int)f;
//cout<<r;
//float i=-1028;
//    printf("num.b=%02X\n",i);
//bool r=2147483647>-2147483648;
//bool r=-1<0u;
//r=(unsigned)-1>-2;
//r=2147483647<(int)2147483648U;
//cout<< sizeof(short);
    return 0;
}